﻿<controls:ChildWindow
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:local="clr-namespace:SilverDesigner;assembly=SDViewModels" x:Class="SilverDesigner.NewDocument"
           Width="400" Height="250" 
           Title="New Document">
    <controls:ChildWindow.Resources>
        <local:OVToBooleanConverter x:Key="OVToBooleanConverter"/>
        <local:OHToBooleanConverter x:Key="OHToBooleanConverter"/>
    </controls:ChildWindow.Resources>
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.RowDefinitions >
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Column="0" Grid.Row="0" Text="Name" VerticalAlignment="center" HorizontalAlignment="left" Margin="5" />
            <TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Name,Mode=TwoWay}" Margin="5" />

            <TextBlock Grid.Column="0" Grid.Row="1" Text="Orientation" VerticalAlignment="Center" HorizontalAlignment="left" Margin="5" />
            <StackPanel Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5">
                <RadioButton GroupName="rdOrinetation" IsChecked="{Binding Orientation, Converter={StaticResource OVToBooleanConverter}, Mode=TwoWay}" Content="Vertical" Margin="5" />
                <RadioButton GroupName="rdOrinetation" IsChecked="{Binding Orientation, Converter={StaticResource OHToBooleanConverter}, Mode=TwoWay}" Content="Horizontal" Margin="5" />
            </StackPanel>

            <TextBlock Grid.Column="0" Grid.Row="2" Text="Width" VerticalAlignment="center" HorizontalAlignment="left" Margin="5" />
            <TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Width,Mode=TwoWay}" Margin="5" Width="100" HorizontalAlignment="Left" />

            <TextBlock Grid.Column="0" Grid.Row="3" Text="Height" VerticalAlignment="center" HorizontalAlignment="left" Margin="5" />
            <TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Height,Mode=TwoWay}" Margin="5" Width="100" HorizontalAlignment="Left" />

        </Grid>
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</controls:ChildWindow>